package xyz.jcat.biz.service.common;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;
import xyz.jcat.common.util.IdWorker;

@Component
public class LeafIdGenerator implements IdentifierGenerator {

    @DubboReference
    private IdWorker idWorker;

    public Number nextId(Object entity) {
        return idWorker.nextId();
    }

}
